﻿using GetSlaughterItem.API.Application.Commands.Week01.BusinessCommends;
using GetSlaughterItem.API.Application.Commands.Week02.GetScaleType01;
using GetSlaughterItem.API.Application.Commands.Week02.GetUPCData;
using GetSlaughterItem.API.Application.Commands.Week02.SegmentationStatement_;
using GetSlaughterItem.API.Application.Commands.Week02.ShowIPQCData;
using GetSlaughterItem.API.Application.Commands.Week02.Splitneck;
using GetSlaughterItem.API.Application.Commands.Week02.Warehouse;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SlaughterItem.API.Application.Commands.Week01.SectionCommands;
using SlaughterItem.API.Application.Commands.Week02.POOK.DepotData;
using SlaughterItem.API.Application.Commands.Week02.POOK.Whitepork;
using SlaughterItem.Common.Dtos;

namespace GetSlaughterItem.API.Controllers.TongShiWei
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TswController : ControllerBase
    {
        private readonly IMediator _mediator;

        public TswController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 获取企业表信息
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowSectionData()
        {
            return await _mediator.Send(new BusinessShowCommand());
        }
        /// <summary>
        /// 获取仓库类型表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> GetDepottypeData()
        {
            return await _mediator.Send(new GetDepotTypeCommand());
        }
        /// <summary>
        /// 获取磅秤类型分类表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> GetScaleTypeData()
        {
            return await _mediator.Send(new GetScaleTypeCommand());
        }
        /// <summary>
        /// 获取商品代号表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> GetUPCData(GetUPCDataCommand cmd)
        {
            return await _mediator.Send(cmd);
        }
        /// <summary>
        /// 获取检测标准表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> GetIPQCData()
        {
            return await _mediator.Send(new ShowIPQCDataCommand());
        }
        /// <summary>
        /// 显示仓库表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowDepotData()
        {
            return await _mediator.Send(new ShowDepotDataCommand());
        }
        /// <summary>
        /// 显示磅秤表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowScaleData()
        {
            return await _mediator.Send(new ScaleDataCommand());
        }
        /// <summary>
        /// 显示分割领用表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowSplitnockData()
        {
            return await _mediator.Send(new ShowSplitneckCommand());
        }
        /// <summary>
        /// 显示商品代号表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowUPCData()
        {
            return await _mediator.Send(new ShowUPCDataCommand());
        }
        /// <summary>
        /// 显示分割入库表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> ShowRKWeightData(SegmentationStatementCommand cmd)
        {
            return await _mediator.Send(cmd);
        }
    }
}
